import React, { useState, useEffect } from 'react'

export default function Index() {
    const [count, setCount] = useState(0)
    useEffect(() => {
        //引入了 count ===> let _count =count
        // 销毁 闭包保留引用的 _count
        setInterval(() => {
            setCount((count) =>{
                return count + 1
            })
        }, 1000)
    }, [])
    return (
    <div>{count}</div>
  )
}
